<?php
class commodity_model extends CI_Model {
	function __construct() {
		parent::__construct();
	}

	public function gets() {
		// オブジェクト
		return $this->db->query("select * from commodity_header")->result();
// 		return $this->db->query("select * from test")->result_array();
	}


	public function get($commodity_code) {
		// オブジェクト
// 		return $this->db->get_where('commodity', array('id'=>$test_id))->row();
		return $this->db->get_where('commodity_detail', array('COMMODITY_CODE'=>$commodity_code))->result();
		// 		return $this->db->query("select * from test")->result_array();
	}

	public function get_description($commodity_code) {
		// オブジェクト
		// 		return $this->db->get_where('commodity', array('id'=>$test_id))->row();
		return $this->db->get_where('commodity_description', array('COMMODITY_CODE'=>$commodity_code))->result();
		// 		return $this->db->query("select * from test")->result_array();
	}

}
